/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */
import React, { useEffect } from 'react';
import { hide } from 'react-native-bootsplash';
import { ModalProvider } from 'react-native-modalfy';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Toast from 'react-native-toast-message';
import { Provider } from 'react-redux';

import { ActionSheetProvider } from '@expo/react-native-action-sheet';

import { DropdownMenuProvider } from './src/components/DropdownMenu/context';
import { modalStack } from './src/components/modalConfig';
import NavigationConfig from './src/components/NavigationConfig';
import SoundPlayer from './src/components/soundPlayer';
import store from './src/stores/store';
import toastConfig from './src/utils/toast.config.tsx';
const App: React.FC = () => {
  useEffect(() => {
    setTimeout(() => hide({ fade: true }), 500);
  }, []);
  return (
    <Provider store={store}>
      <ActionSheetProvider>
        <SafeAreaProvider>
          <SoundPlayer>
            <DropdownMenuProvider>
              <ModalProvider stack={modalStack}>
                <NavigationConfig />
                <Toast config={toastConfig} />
              </ModalProvider>
            </DropdownMenuProvider>
          </SoundPlayer>
        </SafeAreaProvider>
      </ActionSheetProvider>
    </Provider>
  );
};
export default App;
